package com.yaorange.teaching.controller;

import com.yaorange.common.core.web.controller.BaseController;
import com.yaorange.common.core.web.domain.AjaxResult;
import com.yaorange.common.security.annotation.RequiresPermissions;
import com.yaorange.teaching.service.IYaTeacherSechedulingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 课程Controller
 *
 * @author ruoyi
 * @date 2024-11-08
 */
@RestController
@RequestMapping("/teacher_scheduling")
public class YaTeacherSechedulingController extends BaseController
{
    @Autowired
    private IYaTeacherSechedulingService yaTeacherSechedulingService;

    /**
     * 查询课程列表
     */
    @RequiresPermissions("teaching:teacher_scheduling:list")
    @GetMapping("/teaching_plan/list")
    public AjaxResult getTeachingPlanList()
    {
        return AjaxResult.success(yaTeacherSechedulingService.selectTeachingPlanList());
    }


    @RequiresPermissions("teaching:teacher_scheduling:list")
    @PutMapping("/teacher/assignment")
    public AjaxResult updateTeacherAssignment(@RequestParam("currentClass") String className,
                                              @RequestParam("teacher") String teacher,
                                              @RequestParam("date") String date
                                              )
    {
        return AjaxResult.success(yaTeacherSechedulingService.updateTeacherAssignment(className,teacher,date));
    }


}
